home *** CD-ROM | disk | FTP | other *** search
- /*****************************************************************************
-
- RAVE Utilities.h
-
- RAVE Utilities defines a number of useful functions for working with RAVE,
- including functions to find the deepest GDevice, loading textures from a PICT
- resource, and so on. Essentially, it defines a number of pieces of common code
- that were useful to many of my projects.
-
- Author: Timothy Carroll
- Apple Developer Technical Support
- devsupport@apple.com
-
- Modification History:
- 5/1/98 TMC Initial Release
-
- Copyright © 1998 Apple Computer, Inc., All Rights Reserved
-
- You may incorporate this sample code into your applications without
- restriction, though the sample code has been provided "AS IS" and the
- responsibility for its operation is 100% yours. However, what you are
- not permitted to do is to redistribute the source as "DSC Sample Code"
- after having made changes. If you're going to re-distribute the source,
- we require that you make it clear in the source that the code was
- descended from Apple Sample Code, but that you've made changes.
-
- *****************************************************************************/
-
- #ifndef _RAVEUTILITIES_
- #define _RAVEUTILITIES_
-
- #pragma once
-
- #include <RAVE.h>
- #include "Common Stuff.h"
-
-
- /*****************************************************************************
- LOOKUP TABLES
-
- I use SIN and COS in a number of places, and we don't need perfect precision,
- so we generate a set of lookup tables on 0.5 degree increments. Most of the
- 3D math routines use these lookups to generate matrices.
- *****************************************************************************/
-
- extern float gSinArray[721]; // [720] = [0]
- extern float gCosArray[721]; // [720] = [0]
-
- OSStatus InitializeLookups(void);
-
-
- /*****************************************************************************
- RAVE ENGINE FUNCTIONS
-
- FindTextureMappingEngine walks the list of available engines and returns
- the first engine capable of Texture Mapping.
-
- GetListOfEngines creates a handle filled with references to all engines
- available to the application.
- *****************************************************************************/
-
- TQAEngine *FindTextureMappingEngine (TQADevice *device);
- OSStatus GetListOfEngines (GDHandle screen, Handle *list, long *number);
-
-
- /*****************************************************************************
- TEXTURES
-
- LoadTextureFromPictResource loads a PICT resource, draws it into an offscreen
- GWorld, creates a RAVE texture, and then detaches it so that the engine is
- responsible for managing it. Complete texture management code would probably
- want to make sure that the textures are also available as a GWorld, so that
- they can be quickly loaded and unloaded from the card.
- *****************************************************************************/
-
- TQATexture *LoadTextureFromPictResource (TQAEngine *engine, short pictID);
-
-
- #endif _RAVEUTILITIES_
-